<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>第二个react《中奖列表》</title>
    <!-- 1. 引入react核心库 -->
    <script src="../node_modules/react/umd/react.development.js"></script>
    <!-- 2. 引入react-dom 用于支持react操作dom -->
    <script src="../node_modules/react-dom/umd/react-dom.development.js"></script>
</head>
<body>
  <div id="root"></div>

  <!-- <div class="item">
    <h2 class="title">
      <ul class="list">
        <li>1.张三</li>
        <li>1.张三</li>
        <li>1.张三</li>
      </ul>
    </h2>
  </div> -->

</body>

  <script>
    

      /*
       * 三个API：
       * React.createElement(type代表元素的类型, 属性， 节点/子节点)
       * ReactDOM.createRoot   创建根节点 
       * render(ele) // 渲染元素到页面中
       */

       let item = React.createElement('div',{className: 'item',title:'张三'},
          React.createElement('h2',{className: 'title'},'中奖列表',
          React.createElement('ul',{className:'list'},
              React.createElement('li',{onClick:function(){alert('zhangsan')}},'1.张三'), //点击事件onClick驼峰式
              React.createElement('li',null,'2.李四'),
              React.createElement('li',null,'3.王五')
            )
          )
       )

       let root = ReactDOM.createRoot(document.getElementById('root'))

       root.render(item)


  </script>

</html>